package com.hundred.item.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.hundred.item.dao.AppItemDAO;
import com.hundred.item.dao.dataobject.AppItemDO;
import com.hundred.item.dao.dataobject.ItemDO;

public class AppItemDAOImpl extends SqlMapClientDaoSupport implements AppItemDAO {

	public List<AppItemDO> getAppItemByTagId(int tagId) {
		@SuppressWarnings("unchecked")
		List<AppItemDO> itemList = this.getSqlMapClientTemplate().queryForList("AppItem.queryAppItemByTagId", (long)(tagId));
		return itemList;
	}

	public AppItemDO getAppItemById(long itemId) {
		return (AppItemDO) this.getSqlMapClientTemplate().queryForObject("Item.querySingleAppItem",itemId);
	}

	public int updateAppItem(AppItemDO appItemDO) {
		return this.getSqlMapClientTemplate().update("AppItem.updateAppItem", appItemDO);
	}

}
